package com.jeecg.p3.system.poster.service;

import com.jeecg.p3.base.util.DateUtil;
import com.jeecg.p3.system.poster.dao.ScanCodeNumDao;
import com.jeecg.p3.system.poster.entity.ScanCodeNum;
import com.jeecg.p3.system.poster.entity.WhitePerson;
import com.jeecg.p3.system.util.UuidUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
import java.util.List;

/**
 *
 * @ClassName: ScanCodeNumService
 * @Description: TODO 扫码统计处理层
 * @author: zhangxiao
 * @date: 2020年11月30日 下午7:29:38
 */
@Service
public class ScanCodeNumService {
    @Resource
    private ScanCodeNumDao dao;

    /**
     * 根据参数查询扫码统计结果
     * @param scanCodeNum
     * @return
     */
    public List<ScanCodeNum> findByParam(ScanCodeNum scanCodeNum) {
        if(scanCodeNum == null) {
            scanCodeNum = new ScanCodeNum();
        }
        return dao.findByParam(scanCodeNum);
    }

    /**
     * 新增扫码统计
     * @param scanCodeNum
     */
    public void doAdd(ScanCodeNum scanCodeNum) {
        scanCodeNum.setStatus("1");
        scanCodeNum.setId(UuidUtils.getId());
        dao.insert(scanCodeNum);
    }
}
